const add=(x:number,y:number,z?:number):number=>{
    
    if(typeof z=== 'number'){
        return x+y+z;
    }
    return x+y
}

let result = add(1,2,3)

let add2: (x:number,y:number,z?:number) => number= add

interface ISum {
    (x:number,y:number,z?:number): number
}